import fancyBarCode from 'vue3-barcode';
import * as Icons from '@element-plus/icons-vue';
import { GlobalCmComponent } from 'codemirror-editor-vue3';
import formDesigner from './formDesigner.vue';
import formBuilder from './formBuilder.vue';
import formViewer from './formViewer.vue';
import fancyEditor from './extend/fancyEditor.vue';
import fancyHtml from './extend/fancyHtml.vue';
import fancyText from './extend/fancyText.vue';
import fancyDialogList from './extend/fancyDialogList.vue';

// import iconDialog from './iconDialog';

// 引入所有图标

// const plugins = {
//   install: (app) => {

//   },
// };
export function setupFormComponents(app) {
  app.component('FormDesigner', formDesigner);
  app.component('FormBuilder', formBuilder);
  app.component('FormViewer', formViewer);
  app.component('FancyEditor', fancyEditor);
  app.component('FancyHtml', fancyHtml);
  app.component('FancyText', fancyText);
  app.component('FancyBarCode', fancyBarCode);
  // 循环注册所有图标
  for (const name in Icons) {
    app.component(name, Icons[name]);
  }
  app.component('FancyDialogList', fancyDialogList);
  app.use(GlobalCmComponent);
  // app.component('icon-dialog',iconDialog);
}
// export default plugins;
